#ifndef MENCODER_H
#define MENCODER_H

#include "mencoder_global.h"
#include "encoderinterface.h"
#include "encodercodec.h"

#include <QtPlugin>
#include <QWidget>
#include <QHash>
#include <QList>

class MENCODERSHARED_EXPORT Mencoder: public EncoderInterface {
Q_OBJECT
public:
    Mencoder(const QString & dll_path = "");


    Infomation infomation () const;
    TaskId startConvert(EncoderOption *, ConvertOption *cops, int *error_code);
    bool pauseConvert(TaskId);
    bool cancelConvert(TaskId);

    SettingWidgetInterface *configWidget(EncoderOption *, ConvertOption *cops);

    QList<EncoderCodec *> supportedVideoCodecs () ;
    QList<EncoderCodec *> supportedAudioCodecs () ;

    QPixmap capturePreview (const QString &file, int offset_ms);
    int testConversionAvailable (const QString &file);

private:
    void setupInfo();

private:
    QString m_path;
    QHash <QString, EncoderCodec *> m_videoCodecs, m_audioCodecs;
    QHash <QString, SettingWidgetInterface *> m_configWidgets;

private slots:
    void onConfigWidgetDestroyed(QObject *);
};



#endif // MENCODER_H
